board = [["8","3",".",".","7",".",".",".","."]
        ,["6",".",".","1","9","5",".",".","."]
        ,[".","9","8",".",".",".",".","6","."]
        ,["8",".",".",".","6",".",".",".","3"]
        ,["4",".",".","8",".","3",".",".","1"]
        ,["7",".",".",".","2",".",".",".","6"]
        ,[".","6",".",".",".",".","2","8","."]
        ,[".",".",".","4","1","9",".",".","5"]
        ,[".",".",".",".","8",".",".","7","9"]]

def isValidSudoku(board):
    i,j=0,0
    r_len=l_len=len(board)
    while i<r_len:
        dick={'0':True,'1':True,'2':True,'3':True,'4':True,'5':True,'6':True,'7':True,'8':True,'9':True}
        for k in board[i]:
            if k!='.':
                if dick[k]==True:
                    dick[k]=False
                else:
                    return False
        i+=1
    while j<l_len:
        dick = {'0': True, '1': True, '2': True,'3': True,'4': True,'5': True,'6': True,'7': True,'8': True,'9': True}
        k=0
        while k<r_len:
            if board[k][j]!='.':
                if dick[board[k][j]]==True:
                    dick[board[k][j]]=False
                else:
                    return False
            k+=1
        j+=1
    

print(isValidSudoku(board))


